package losrebellos.media.cuepoint.net
{
	import flash.display.MovieClip;
	import flash.events.EventDispatcher;

	/*
	 *
	 * @author los rebellos - ben@benoitvinay.com
	 *
	 */
	public class MovieClipCuePointManager extends CuePointManager implements IMovieClipCuePointManager
	{
		/*
		 *
		 * VARIABLES
		 *
		 */
		private var _movieClip:MovieClip;
		
		
		/*
		 *
		 * CONSTRUCTOR
		 *
		 */
		public function MovieClipCuePointManager(movieClip:MovieClip = null, custom:Boolean = true)
		{
			super(movieClip, custom);
		}
		
		
		/*
		 * 
		 * PROPERTIES
		 * 
		 */
		public function set movieClip(value:MovieClip):void 
		{
			media = value;
		}
		override protected function set media(value:EventDispatcher):void 
		{		
			super.media = value;
			
			_movieClip = value as MovieClip;
		}
		
		
		/*
		 * 
		 * TIMING
		 * 
		 */
		override protected function getTimeFromMedia():Number
		{
			return _movieClip.currentFrame / _movieClip.stage.frameRate;
		}
	}
}